class DeliveryItem {
  int itemcode;      // 项目类型(001 瓶盖002卡片003统退纸箱数004统退周转箱数)
  int? shouldamount;     // 应收数量
  int actualamount;      // 实收数量
  String shopCode;    // 店号
  String shopName;    // 点名
  String reason;    // 单位 (箱，个，袋)
  String comment;    // 备注
  String createDate;    // 创建时间
  int sequenceId;    // 线路Id
  String waybillNumber;    // 订单号

  DeliveryItem({
    required this.itemcode,
    this.shouldamount,
    required this.actualamount,
    required this.shopCode,
    required this.shopName,
    required this.reason,
    required this.comment,
    required this.createDate,
    required this.sequenceId,
    required this.waybillNumber,
  });

  factory DeliveryItem.fromJson(Map<String, dynamic> json) {
    return DeliveryItem(
        itemcode: json['itemcode'] ?? '',
        shouldamount: json['shouldamount'] ?? '',
        actualamount: json['actualamount'] ?? '',
        shopCode: json['shopCode'] ?? '',
        shopName: json['shopName'],
        reason: json['reason'],
        comment: json['comment'],
        createDate: json['createDate'],
        sequenceId: json['sequenceId'],
        waybillNumber: json['waybillNumber']
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'itemcode': itemcode,
      'shouldamount': shouldamount,
      'actualamount': actualamount,
      'shopCode': shopCode,
      'shopName': shopName,
      'reason': reason,
      'comment': comment,
      'createDate': createDate,
      'sequenceId': sequenceId,
      'waybillNumber': waybillNumber,
    };
  }
}